package infra

import (
	"io"
	"log"
	"net/http"
)

type Retriever struct {
}

func (Retriever) Get(url string) string {
	resp, err := http.Get(url)
	if err != nil {
		log.Fatalln(err)
	}
	defer func() { resp.Body.Close() }()
	all, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatalln(err)
	}
	// bytes -> string
	return string(all)
}
